package com.sxkiler.demo.rpc.service.impl;

import com.sxkiler.demo.rpc.model.RpcService;
import com.sxkiler.demo.rpc.pojo.Book;
import com.sxkiler.demo.rpc.service.BookService;

/**
 * //自定义注解，服务注入
 */
@RpcService(serviceName = "BookServiceImpl")
public class BookServiceImpl implements BookService {
    @Override
    public Book getBook(Integer id) {
        return new Book(id,"大悲赋");
    }

    @Override
    public Book updateBook(Book book) {
        book.setBookName("修改后："+book.getBookName());
        return book;
    }

    @Override
    public Integer delBook(Integer id) {
        return id;
    }

    @Override
    public Integer insertBook(Book book) {
        return book.getId();
    }
}
